﻿<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeBehind="EstadoLCSItemInspecaoLista.aspx.cs" Inherits="InfraWEB.UI.EstadoLCSItemInspecaoLista" MasterPageFile="~/AdminMaster.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style3
        {
            color: #507CD1;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div>
	    <h1 class="style3">Lista de Estados de Item de Inspeção</h1>
	    <div class="error">
		    <asp:Label runat="server" ID="lblMensagem" Visible="false"></asp:Label>
	        <br />
	    </div>
	    <div class="oneline">
		    <asp:Button ID="btnNovoEstadoLCSItemInspecao" Text="Novo Estado de Item de Inspeção"  onclick="btnNovoEstadoLCSItemInspecao_Click" runat="server"/>
	        <br />
            <br />
	    </div>
	    <asp:GridView ID="estadoGridView" runat="server" CellPadding="4" 
            ForeColor="#333333" GridLines="None" AllowPaging="True" 
            AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="EliId" 
            DataSourceID="SqlDataSource1">
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:BoundField DataField="EliNome" HeaderText="Nome" 
                    SortExpression="EliNome" />
                <asp:BoundField DataField="TiiId" HeaderText="Tipo" SortExpression="TiiId" />
                <asp:CommandField DeleteText="Apagar" EditText="Editar" ShowDeleteButton="True" 
                    ShowEditButton="True" />
            </Columns>
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:infraConnectionString %>" 
            DeleteCommand="DELETE FROM [EstadoLCSItemInspecao] WHERE [EliId] = @EliId" 
            InsertCommand="INSERT INTO [EstadoLCSItemInspecao] ([EliNome], [TiiId]) VALUES (@EliNome, @TiiId)" 
            SelectCommand="SELECT * FROM [EstadoLCSItemInspecao]" 
            
            UpdateCommand="UPDATE [EstadoLCSItemInspecao] SET [EliNome] = @EliNome, [TiiId] = @TiiId WHERE [EliId] = @EliId">
            <DeleteParameters>
                <asp:Parameter Name="EliId" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="EliNome" Type="String" />
                <asp:Parameter Name="TiiId" Type="Int32" />
                <asp:Parameter Name="EliId" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="EliNome" Type="String" />
                <asp:Parameter Name="TiiId" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
    </div>
</asp:Content>
